package com.hatricks.is.system;

import cn.hutool.core.thread.ThreadUtil;

import javax.swing.*;

/**
 * @packageName: com.hatricks.is.system
 * @className: SystemExitTest
 * @author: yanyuhui y568821795@outlook.com
 * @date: 2024-08-24 08:40
 * @description:
 */
public class SystemExitTest {

    public static void main(String[] args) {
        System.out.println("我想要测试exit的逻辑");

        // gui启动独立子进程进行图片绘制
        SwingUtilities.invokeLater(()-> {
            ThreadUtil.execAsync(() -> {
                System.out.println("异步线程执行exit");
                System.exit(100);
            });
        });

        System.out.println("执行到我了吗");
        ThreadUtil.safeSleep(2000);
        System.out.println("还能执行到我吗");
    }
}
